﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;
namespace Demo_HHT_EARTH
{
    public partial class EQCheckInConfirm : UserControl
    {
        SQLiteConnection cn2 = new SQLiteConnection();
        string strconinsert = string.Empty;
        public EQCheckInConfirm()
        {
            InitializeComponent();
            label4.Text = Demo_HHT_EARTH.DataGetEqCheckIn.eq_code;
        }

        private void button1_Click(object sender, EventArgs e)
        {

            try
            {
                cn2.ConnectionString = "Data Source=|DataDirectory|db.sqlite";
            }
            catch (Exception)
            {

                MessageBox.Show("notconect SQLite");
            }
            strconinsert = "INSERT INTO [t_earth_flight_equipment] (fid,equipment_code,equipment_description,status,check_in_flag) VALUES('"
                           + "" + ""
                           + "','" + Demo_HHT_EARTH.DataGetEqCheckIn.eq_code
                           + "','" + "UNKNOWN"
                           + "','" + "UNKNOWN"
                           + "','" + "YES"
                           + "')";


            SQLiteCommand command = new SQLiteCommand(strconinsert, cn2);
            cn2.Open();
            command.Connection = cn2;

            command.ExecuteNonQuery();
            cn2.Close();
            string s = "success";
            Demo_HHT_EARTH.EQcheckin EQ = new EQcheckin(s);

            EQ.Show();
           
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Demo_HHT_EARTH.EQcheckin EQ = new EQcheckin("");

            EQ.Show();
        }
    }
}
